#include "gtest/gtest.h"

#include "ObjectTest.h"
#include "helper/ScopedMemPtr.h"


using namespace helper;
using namespace object;

class RawTypeTest : public ObjectTest {
public:
};


TEST_F(RawTypeTest, testInteger){
    int expect = 10;
    helper::ScopedMemPtr<Integer> pObj(getObjectFactory()->createInteger(expect));
    ASSERT_EQ(expect, pObj->get());

    ASSERT_EQ(Object::INTEGER, pObj->getType());
    ASSERT_TRUE(pObj->isInteger());
}

TEST_F(RawTypeTest, testDouble){
    double expect = 1000.0;
    ScopedMemPtr<Double> pObj(getObjectFactory()->createDouble(expect));
    ASSERT_EQ(expect, pObj->get());

    ASSERT_EQ(Object::DOUBLE, pObj->getType());
    ASSERT_TRUE(pObj->isDouble());
}
TEST_F(RawTypeTest, testByte){
    char expect = '1';
    helper::ScopedMemPtr<Byte> pObj(getObjectFactory()->createByte(expect));
    ASSERT_EQ(expect, pObj->get());

    ASSERT_EQ(Object::BYTE, pObj->getType());
    ASSERT_TRUE(pObj->isByte());
}
